#import <Foundation/Foundation.h>

#import "Shape.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        Shape *shape = [Shape new];
        
        Line *line = [Line new];
        shape.lineRetained = line;
        NSLog(@"%lu", line.retainCount);
        NSLog(@"%p: %p", line, shape.lineRetained);
        [line release];
        
        Line *line2 = [Line new];
        NSLog(@"------");
        shape.lineRetained = line2;
        NSLog(@"------");
        [line2 release];

        
#if 0
        Line *lineCopy = [Line new];
        shape.lineCopy = lineCopy;
        NSLog(@"%p: %p", lineCopy, shape.lineCopy);
        NSLog(@"%lu: %lu", lineCopy.retainCount, shape.lineCopy.retainCount);
        [lineCopy release];
        
        Line *lineCopy2 = [Line new];
        shape.lineCopy = lineCopy2;
        NSLog(@"%p: %p", lineCopy, shape.lineCopy);

        [lineCopy2 release];
#endif
        
#if 0
        Line *line = [Line new];
        shape.line = line;
        NSLog(@"%lu", line.retainCount);
        [line release];
#endif
        
#if 0
        shape.color = 1;
        NSLog(@"%d", shape.color);
#endif
        
        [shape release];
    }
    return 0;
}
